<?php

namespace addons\qingdong\validate;

use think\Validate;

//回款
class Receivables extends Validate {
	/**
	 * 验证规则
	 */
	protected $rule = [
		'create_staff_id' => 'require|number',
		'owner_staff_id'  => 'require|number',
		'customer_id'     => 'require|number',
		'contract_id'     => 'number',
		'number'          => 'max:64',
		'money'           => 'number',
		'return_type'     => 'max:64',
		'return_time'     => 'date',
		'plan_id'         => 'number',
		'remarks'         => 'max:250',
	];
	/**
	 * 提示消息
	 */
	protected $message = [];
	/**
	 * 字段描述
	 */
	protected $field = [
		'create_staff_id' => '员工',
		'owner_staff_id'  => '员工',
		'customer_id'     => '所属客户',
		'contract_id'     => '所属合同',
		'number'          => '回款编号',
		'money'           => '回款金额',
		'return_time'     => '回款日期',
		'return_type'     => '回款方式',
		'remarks'         => '备注信息',
		'flow_staff_ids' => '审批人',
		'plan_id'         => '期数',
	];
	/**
	 * 验证场景
	 */
	protected $scene = [
		'create' => [
			'customer_id',
			'contract_id',
			'number',
			'money',
			'return_time',
			'return_type',
			'flow_staff_ids',
			'remarks',
			'plan_id'
		],
		'edit'   => [],
	];
}
